package com.his.controller;

import com.his.common.Rsp;
import com.his.entity.NursingCategory;
import com.his.service.NursingCategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (NursingCategory)表控制层
 *
 * @author makejava
 * @since 2020-10-23 18:13:38
 */
@RestController
@RequestMapping("nursingCategory")
public class NursingCategoryController {
    /**
     * 服务对象
     */
    @Resource
    private NursingCategoryService nursingCategoryService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public NursingCategory selectOne(Integer id) {
        return this.nursingCategoryService.queryById(id);
    }


    @GetMapping("selectAll")
    public Rsp selectAll(){
        return Rsp.success(nursingCategoryService.queryAll(null));
    }
}